﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using Common.Library;
using System.Windows.Navigation;
using MyToolkit.Multimedia;
using System.ComponentModel;
using OnlineVideos.UI;
using OnlineVideos.Utilities;
using Common.Utilities;

namespace OnlineMovies.Views
{
    public partial class VideoGameHistory : PhoneApplicationPage
    {
        string pivotimage = string.Empty;
        public VideoGameHistory()
        {
            InitializeComponent();          
        }
        private void PhoneApplicationPage_Loaded(object sender, RoutedEventArgs e)
        {
            try
            {
                FlurryWP8SDK.Api.LogEvent("VideoGameHistory Page", true);
            }
            catch (Exception ex)
            {

                Exceptions.SaveOrSendExceptions("Exception in PhoneApplicationPage_Loaded Method In VideoGameHistory.cs file.", ex);
            }
        }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            try
            {
                FlurryWP8SDK.Api.LogPageView();
                YouTube.CancelPlay();
            }
            catch (Exception ex)
            {
                
            Exceptions.SaveOrSendExceptions("Exception in OnNavigatedTo Method In VideoGameHistory.cs file.", ex);
            }
        }
        protected override void OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e)
        {
            try
            {
                FlurryWP8SDK.Api.EndTimedEvent("VideoGameHistory Page");

            }
            catch (Exception ex)
            {

                Exceptions.SaveOrSendExceptions("Exception in OnNavigatedFrom Method In VideoGameHistory.cs file.", ex);
            }
        }
        protected override void OnBackKeyPress(CancelEventArgs e)
        {
            if (YouTube.CancelPlay())
                e.Cancel = true;

            base.OnBackKeyPress(e);
        }
        private void imgTitle_MouseEnter(object sender, MouseEventArgs e)
        {
            NavigationService.Navigate(NavigationHelper.MainPanoramaPage);
        }
    }
}